package com.lt.basic.project.pojo.validate.mino.user;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.lt.basic.project.common.util.StringUtils;
import com.lt.basic.project.pojo.entity.mino.user.User;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 用户信息表(basic_user)搜素对象
 * @author ：LT
 * @Created in : 2023-11-27
 */
@Data
@ApiModel(value="User搜素对象", description = "用户信息表搜素对象")
public class UserSearchValidate implements Serializable {

    private static final long serialVersionUID=1L;



    /**
     * 编号
     */
    @ApiModelProperty(value = "编号")
    private Integer sn;

    /**
     * 头像
     */
    @ApiModelProperty(value = "头像")
    private String avatar;

    /**
     * 真实姓名
     */
    @ApiModelProperty(value = "真实姓名")
    private String realName;

    /**
     * 用户昵称
     */
    @ApiModelProperty(value = "用户昵称")
    private String nickname;

    /**
     * 用户账号
     */
    @ApiModelProperty(value = "用户账号")
    private String username;

    /**
     * 用户密码
     */
    @ApiModelProperty(value = "用户密码")
    private String password;

    /**
     * 用户电话
     */
    @ApiModelProperty(value = "用户电话")
    private String mobile;

    /**
     * 用户钱包
     */
    @ApiModelProperty(value = "用户钱包")
    private BigDecimal money;

    /**
     * 加密盐巴
     */
    @ApiModelProperty(value = "加密盐巴")
    private String salt;

    /**
     * 用户性别: [1=男, 2=女]
     */
    @ApiModelProperty(value = "用户性别: [1=男, 2=女]")
    private Integer sex;

    /**
     * 注册渠道: [1=微信小程序, 2=微信公众号, 3=手机H5, 4=电脑PC, 5=苹果APP, 6=安卓APP]
     */
    @ApiModelProperty(value = "注册渠道: [1=微信小程序, 2=微信公众号, 3=手机H5, 4=电脑PC, 5=苹果APP, 6=安卓APP]")
    private Integer channel;

    /**
     * 是否禁用: [0=否, 1=是]
     */
    @ApiModelProperty(value = "是否禁用: [0=否, 1=是]")
    private Integer isDisable;

    /**
     * 是否删除: [0=否, 1=是]
     */
    @ApiModelProperty(value = "是否删除: [0=否, 1=是]")
    private Integer isDelete;

    /**
     * 是否是新注册用户: [1-是, 0-否]
     */
    @ApiModelProperty(value = "是否是新注册用户: [1-是, 0-否]")
    private Integer isNew;

    /**
     * 最后登录IP
     */
    @ApiModelProperty(value = "最后登录IP")
    private String lastLoginIp;

    /**
     * 最后登录时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "最后登录时间")
    private Date lastLoginTime;

    /**
     * 创建时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    /**
     * 更新时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    /**
     * 删除时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "删除时间")
    private Date deleteTime;



    /**
    * 查询数据过滤
    */
    public void query(UserSearchValidate searchValidate, LambdaQueryWrapper<User> lqw) {
        if (StringUtils.isNotObj(searchValidate.getSn())) {
            lqw.eq(User::getSn, searchValidate.getSn());
        }
        if (StringUtils.isNotObj(searchValidate.getAvatar())) {
            lqw.eq(User::getAvatar, searchValidate.getAvatar());
        }
        if (StringUtils.isNotObj(searchValidate.getRealName())) {
            lqw.eq(User::getRealName, searchValidate.getRealName());
        }
        if (StringUtils.isNotObj(searchValidate.getNickname())) {
            lqw.eq(User::getNickname, searchValidate.getNickname());
        }
        if (StringUtils.isNotObj(searchValidate.getUsername())) {
            lqw.eq(User::getUsername, searchValidate.getUsername());
        }
        if (StringUtils.isNotObj(searchValidate.getPassword())) {
            lqw.eq(User::getPassword, searchValidate.getPassword());
        }
        if (StringUtils.isNotObj(searchValidate.getMobile())) {
            lqw.eq(User::getMobile, searchValidate.getMobile());
        }
        if (StringUtils.isNotObj(searchValidate.getMoney())) {
            lqw.eq(User::getMoney, searchValidate.getMoney());
        }
        if (StringUtils.isNotObj(searchValidate.getSalt())) {
            lqw.eq(User::getSalt, searchValidate.getSalt());
        }
        if (StringUtils.isNotObj(searchValidate.getSex())) {
            lqw.eq(User::getSex, searchValidate.getSex());
        }
        if (StringUtils.isNotObj(searchValidate.getChannel())) {
            lqw.eq(User::getChannel, searchValidate.getChannel());
        }
        if (StringUtils.isNotObj(searchValidate.getIsDisable())) {
            lqw.eq(User::getIsDisable, searchValidate.getIsDisable());
        }
        if (StringUtils.isNotObj(searchValidate.getIsDelete())) {
            lqw.eq(User::getIsDelete, searchValidate.getIsDelete());
        }
        if (StringUtils.isNotObj(searchValidate.getIsNew())) {
            lqw.eq(User::getIsNew, searchValidate.getIsNew());
        }
        if (StringUtils.isNotObj(searchValidate.getLastLoginIp())) {
            lqw.eq(User::getLastLoginIp, searchValidate.getLastLoginIp());
        }
        if (StringUtils.isNotObj(searchValidate.getLastLoginTime())) {
            lqw.eq(User::getLastLoginTime, searchValidate.getLastLoginTime());
        }
        if (StringUtils.isNotObj(searchValidate.getCreateTime())) {
            lqw.eq(User::getCreateTime, searchValidate.getCreateTime());
        }
        if (StringUtils.isNotObj(searchValidate.getUpdateTime())) {
            lqw.eq(User::getUpdateTime, searchValidate.getUpdateTime());
        }
        if (StringUtils.isNotObj(searchValidate.getDeleteTime())) {
            lqw.eq(User::getDeleteTime, searchValidate.getDeleteTime());
        }
    }

}